package net.chenlin.dp.modules.task;

import net.chenlin.dp.modules.business.dao.DeviceCalibrationMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author Yangsm
 * @ClassName: DeviceCalibrationDetailTask
 * @Description: 计算校准时间范围内每个相序的设备计量电量
 * @date 2023年11月24日 10:36
 */
public class DeviceCalibrationDetailTask {

    @Autowired
    private DeviceCalibrationMapper mapper;

    //@Transactional(rollbackFor = Exception.class)
    //@Scheduled(cron = "0 0/1 * * * ?")
    public void getCountDeviceMeteredElectricity() throws Exception {

        // 获取需要计算的设备编号
        List<String> deviceNoList = mapper.getCheckDeviceNo();
        deviceNoList.stream().forEach(deviceNo -> {
            mapper.countCheckDeviceMeteredElectricity(deviceNo);
        });
    }

}
